import java.util.Scanner;

public class Today {
    public static int getElement(int[] array, int index){
        if(null == array){
            throw new RuntimeException("为空指针");
        }
        if(index < 0 || index >= array.length){
            throw new ArrayIndexOutOfBoundsException("传递的数组下标越界");
        }
        return array[index];
    }
    public static void main(String[] args) {
        int[] array = {1,2,3};
        System.out.println( getElement(array, 2));
    }

    public static int main1(String[] args) {
        StringBuilder name = new StringBuilder("liu");
        System.out.println(name.append("xin"));
        System.out.println(name.append("chegn"));
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int[] count = new int[256];
        for (int i = 0; i < s.length(); i++) {
            count[(int) s.charAt(i)]++;
        }
        for (int i=0;i<s.length();i++){
            if(count[s.charAt(i)]==1){
                return i;
            }
        }
        return -1;
    }
}

